package com.shengyi.controller;

import com.shengyi.common.Result;
import com.shengyi.model.CarFinance;
import com.shengyi.model.request.FinanceRequest;
import com.shengyi.service.FinanceService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.List;

@Controller
@RequestMapping(value = "/finance/")
public class CarFinanceController {
    @Autowired
    private FinanceService financeService;

    @PostMapping(value = "getFinanceByTime")
    @ResponseBody
    public Result<List<CarFinance>> getFinanceByTime(@RequestBody FinanceRequest request){
        return financeService.getFinanceByTime(request.getStart(),request.getEnd());
    }
}
